feat(helm): Helm template for Celery beat (for reporting and alerting)#13116
feat(helm): Helm template for Celery beat (for reporting and alerting)#13116craig-rueda merged 14 commits intoapache:masterfrom Yann-J:feature/helm-beat
Conversation
vnourdin
left a comment
There was a problem hiding this comment.
Thanks for your PR! I said on Slack that I would open one, but as our templates aren't up-to-date with those of master it took me some time 😅
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ template "superset.fullname" . }}-beat |
There was a problem hiding this comment.
I initially named the pods the same way you did, but some colleague said that beat is kind of generic, and it would be better naming it {{ template "superset.fullname" . }}-celerybeat.
I let you judge 😉
There was a problem hiding this comment.
Yeah that makes sense...
| checksum/superset_config.py: {{ include "superset-config" . | sha256sum }} | ||
| checksum/connections: {{ .Values.supersetNode.connections | toYaml | sha256sum }} | ||
| checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }} | ||
| checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml | sha256sum }} | ||
| checksum/configOverrides: {{ .Values.configOverrides | toYaml | sha256sum }} |
There was a problem hiding this comment.
[K8S newbie] What's the point of those annotations?
There was a problem hiding this comment.
Since those values will change on any content updates of the source values, this will force a patch of the Deployment, and a restart of the pods whenever we publish an update to these (otherwise, updates to a ConfigMap does not automatically force the pods mounting them to restart).
|
Also, we need to add documentation on the K8S part about this celery beat, I think this PR is the good one to do it! |
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Yes, I agree this deserves a documentation update. Another thing I've been wondering about is Celery Flower... I'm a total noob about Celery / Flask... and in fact Python in general, so I'm not 100% sure what |
|
Flower is an interface that allow us to monitor celery workers and see which worker run which task! |
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
OK. So from a Helm point of view this would mean that:
|
|
| command: | ||
| - "/bin/sh" | ||
| - "-c" | ||
| - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery beat --app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule" |
There was a problem hiding this comment.
There is no trace of flower in the master chart in fact 😮 To add it, we should do something really similar to this PR, plus a service dedicated to flower.
I think this is out of the scope of this PR, my team will switch back to the master charts, and we will open PR to add what's missing, but not sure when this will be. 😕
If you have some time to do it, I would gladly help!
There was a problem hiding this comment.
Agreed, different PR... and probably not high prio...
There was a problem hiding this comment.
Agree, but flower by default does not support auth, and it exposes dangerous functionality and sensitive info. May be a bit out of scope
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
|
Sorry, I forgot to update the template to reflect the |
|
No problem, Github suggestions isn't perfect 😅 |
dpgaspar
left a comment
There was a problem hiding this comment.
LGTM, the suggestion on how to add the webdriver is not ideal. Calling @craig-rueda here for some additional thoughts
| command: | ||
| - "/bin/sh" | ||
| - "-c" | ||
| - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery beat --app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule" |
There was a problem hiding this comment.
Agree, but flower by default does not support auth, and it exposes dangerous functionality and sensitive info. May be a bit out of scope
Yes I definitely agree... installing stuff at runtime isn't a really good practice since it creates extra risks and often requires running as Btw I would argue that the same goes for the way extra pip packages are installed (which also requires running the containers as |
SUMMARY
This PR adds an optional kubernetes
Deploymentto run the Celery beat, which is needed in order to trigger the scheduled alerts and reports (as per the excellent unpublished guide at https://github.com/apache/superset/blob/4fa3b6c7185629b87c27fc2c0e5435d458f7b73d/docs/src/pages/docs/installation/email_reports.mdx).It is off by default, and needs to be enabled with
supersetBeat.enabled.The new pod is defined pretty much exactly like the worker pod except that:
replicasis always 1, since this needs to be a singletonNote that for the chart to be able to execute reports, we still need to check all the other boxes, in particular:
supersetWorker.command(this is only needed in the worker container) with the existing chart, with something like this in yourvalues.yaml:superset_config.py. This is now possible with the latest chart frommasterby specifying overrides in yourvalues.yamlsuch as:The above would probably need to be added to the doc together with PR #13104 for the Kubernetes case.
TEST PLAN
values.yamlwithsupersetBeat.enabled: trueand upgrade your chart releaseADDITIONAL INFORMATION